#!/bin/bash
## 设置阿里源
#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
##curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
#wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
#
#mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
##yum  install epel-release
#yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
#sed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
#sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
#
#
#yum makecache
#yum update -y

curl -L https://gitee.com/ZeloZhang/manjaro/raw/master/antigen/antigen.zsh > antigen.zsh
chmod 755 antigen.zsh
mkdir -p /usr/share/zsh/share/
mv  antigen.zsh /usr/share/zsh/share/antigen.zsh
curl -o zshrc https://gitee.com/ZeloZhang/manjaro/raw/master/antigen/zshrc
mv zshrc ~/.zshrc
# centos8 no chsh
dnf install util-linux-user git vim wget tmux  -y



# init tmux
cd 
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .

## spacevim
#curl -sLf https://spacevim.org/cn/install.sh | bash
## docker
#sudo yum install -y yum-utils device-mapper-persistent-data lvm2
#sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#sudo yum makecache fast
#sudo yum -y install docker-ce
#sudo service docker start
##docker 加速
#sudo mkdir -p /etc/docker
#sudo tee /etc/docker/daemon.json <<-'EOF'
#{
#  "registry-mirrors": ["https://uxk0ognt.mirror.aliyuncs.com"]
#}
#EOF
#
#sudo systemctl daemon-reload
#sudo systemctl restart docker
##docker redis mysql
#docker pull mysql
#mkdir  -p ~/Dev/docker/mysql/data
#mkdir  -p ~/Dev/docker/mysql/conf
#mkdir  -p ~/Dev/docker/mysql/logs
#cd  ~/Dev/docker/mysql
#docker run -p 3306:3306 --name mysql -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root -d mysql
#
#docker pull redis
#mkdir  -p ~/Dev/docker/redis/data
#cd ~/Develops/docker/redis
#docker run -p 6379:6379 -v $PWD/data:/data  -d redis redis-server --appendonly yes
#cd ~


## 卸载图形界面
#systemctl set-default multi-user.target
#echo '设置字符界面启动'
#yum groupremove "GNOME Desktop Environment" -y
#yum groupremove "X Window System" -y
#echo 'gnome desktop 卸载完成'


##设置pip源
dnf install python38 python38-pip
mkdir ~/.pip
echo '[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com
' > ~/.pip/pip.conf

## install ranger
wget  https://ranger.github.io/ranger-stable.tar.gz
tar -zxf ranger-stable.tar.gz
cd ranger-1.9.3
sudo make install
pip3 install ranger
sudo python setup.py install --optimize=1 --record=install_log.txt


## 安装nodejs yarn
curl -sL https:/rpm.nodesource.com/setup_13.x | bash -
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
yum install -y nodejs yarn
yarn config set registry 'https://registry.npm.taobao.org'
npm config set registry 'https://registry.npm.taobao.org'


chsh -s /bin/zsh
zsh
